home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PCASM1.ZIP / APP1.DOC < prev    next >
Text File  |  1990-08-02  |  29KB  |  736 lines

  1.  
  2.  
  3.  
  4.                                                                              i
  5.  
  6.                               THE PC ASSEMBLER HELPER
  7.  
  8.  
  9.              "The PC Assembler Helper" is an object module (ASMHELP.OBJ) which
  10.              is designed as a companion for "The PC Assembler Tutor". It can
  11.              also be used as an aid in the development of assembler programs
  12.              and subprograms. It allows for input to and output from the
  13.              assembler level, as well as displaying the data in all the 8086
  14.              registers. Part 1 will give a discription of all callable
  15.              subroutines and part 2 will explain how to correctly link a
  16.              program to ASMHELP.OBJ.
  17.  
  18.  
  19.              THE SUBROUTINES
  20.  
  21.              There are a number of routines for displaying data and for
  22.              inputting data. They all follow a standard format.
  23.  
  24.                  (1) All subroutines which display output on the monitor at
  25.                  the current cursor position start with the word "print_". On
  26.                  the screen, all hex output is followed by an 'H'. All signed
  27.                  output has a + or a -. Unsigned output has no sign. All
  28.                  binary output is distinguishable because it is either 8
  29.                  digits or 16 digits long. ASCII output is followed by a
  30.                  single asterisk '*' under normal conditions. If one or more
  31.                  of the ASCII characters cannot be printed (i.e. if it is
  32.                  less than 33d or it is 127d or 255d){1} then it will be
  33.                  displayed as a two digit hex number instead of a single
  34.                  character. A double asterisk '**' is then used to signal the
  35.                  presence of a hex number in an ASCII format. The only time
  36.                  there might be confusion is if one of the characters is also
  37.                  an asterisk. 
  38.  
  39.                  (2) All subroutines which get input from the keyboard start
  40.                  with the word "get_". They all display prompts to tell you
  41.                  what kind of input is desired.
  42.  
  43.                  (3) One byte input or output is passed through register AL.
  44.                  One word (two byte) input or output is passed through
  45.                  register AX. Any input or output that is longer than two
  46.                  bytes is passed by reference. The offset address of the data
  47.                  is put into AX before calling the subroutine. 
  48.  
  49.              Each subroutine returns with all 8086 registers (including the
  50.              flags register) unchanged from when the subroutine was called. 
  51.              As an example, if "variable3" is the name of a variable (in
  52.              memory) which we want to print as a signed number, the proper way
  53.              to set up for the calls is:
  54.  
  55.  
  56.              ____________________
  57.  
  58.                 1 In this chapter, as in all others, 'd' stands for decimal,
  59.              'h' for hex.
  60.  
  61.              ______________________
  62.  
  63.              The PC Assembler Tutor - Copyright (C) 1989 Chuck Nelson
  64.  
  65.  
  66.  
  67.  
  68.              The PC Assembler Tutor                                         ii
  69.              ______________________
  70.  
  71.              ONE BYTE:
  72.                  mov  al, variable3
  73.                  call print_signed_byte
  74.  
  75.              ONE WORD:
  76.                  mov  ax, variable3
  77.                  call print_signed
  78.  
  79.              FOUR BYTES:
  80.                  lea  ax, variable3
  81.                  call print_signed_4byte
  82.  
  83.              EIGHT BYTES:
  84.                  lea  ax, variable3
  85.                  call print_signed_8byte
  86.  
  87.              For a byte or a word we use the data itself, while for data
  88.              larger than a word we pass the data by reference. The same
  89.              applies for getting input. Here are the subroutines:
  90.  
  91.              get_num
  92.                  Enters a number 5 digits or less, either signed or unsigned.
  93.                  It does no checking to see if the number is too positive or
  94.                  too negative. Returns a two byte value in AX.
  95.  
  96.              print_num
  97.                  Prints a word value (from AX) in its signed, unsigned, hex,
  98.                  ASCII, and binary representation.
  99.  
  100.  
  101.              All the other input routines do strict error checking. If an
  102.              illegal character is entered or if the input is out of range, the
  103.              subroutine will ask for new input until it receives valid input.
  104.  
  105.  
  106.  
  107.              get_string
  108.                  Enters a string of 79 characters or less, and puts a 00h at
  109.                  the end of the string (a C string with a maximum total
  110.                  length of 80 bytes). The address of the string must be in AX
  111.                  before making the call.
  112.  
  113.              print_string
  114.                  Displays a 00h terminated string (a C string) on the
  115.                  monitor. The address of the first byte of the string must be
  116.                  in AX before making the call.
  117.  
  118.  
  119.  
  120.              get_ascii_byte
  121.                  Enters a single ascii character and returns it in AL.
  122.  
  123.              print_ascii_byte
  124.                  Displays one byte (from AL) as an ascii character.
  125.  
  126.              get_ascii
  127.                  Enters one or two characters and returns it (them) in AX.
  128.  
  129.  
  130.  
  131.  
  132.              Appendix I - The PC Assembler Helper                          iii
  133.              ____________________________________
  134.  
  135.  
  136.              print_ascii
  137.                  Displays the value in AX as two characters.
  138.  
  139.  
  140.  
  141.              get_bcd
  142.                  Enters a one to eighteen digit signed number as a 10 byte
  143.                  bcd number. Commas are allowed. The address of the bcd
  144.                  variable must be in AX before calling the routine.
  145.  
  146.              print_bcd
  147.                  Displays a 10 byte bcd number as a one to eighteen digit
  148.                  signed number with commas. The address of the bcd number
  149.                  must be in AX before calling the subroutine.
  150.  
  151.  
  152.  
  153.              get_binary_byte
  154.                  Enters a one to eight digit binary number and returns it in
  155.                  AL.
  156.  
  157.              print_binary_byte
  158.                  Displays a one byte number (from AL) as an eight digit
  159.                  binary number.
  160.  
  161.              get_binary
  162.                  Enters a one to sixteen digit binary number and returns it
  163.                  in AX.
  164.  
  165.              print_binary
  166.                  Displays a one word number (from AX) as a sixteen digit
  167.                  binary number.
  168.  
  169.  
  170.  
  171.              get_hex_byte
  172.                  Enters a one or two digit hex number and returns it in AL.
  173.  
  174.              print_hex_byte
  175.                  Displays a one byte number (in AL) as two hex digits.
  176.  
  177.              get_hex
  178.                  Enters a one to four digit hex number and returns it in AX.
  179.  
  180.              print_hex
  181.                  Displays a one word number (from AX) as a four digit hex
  182.                  number.
  183.  
  184.  
  185.  
  186.              get_signed_byte
  187.                  Enters a one byte signed number (-128 to +127) and returns
  188.                  it in AL.
  189.  
  190.              print signed_byte
  191.                  Displays a one byte number (from AL) as a signed number
  192.  
  193.  
  194.  
  195.  
  196.              The PC Assembler Tutor                                         iv
  197.              ______________________
  198.  
  199.                  (-128 to +127).
  200.  
  201.              get_signed
  202.                  Enters a one word signed number (-32768 to +32767) and
  203.                  returns it in AX.
  204.  
  205.              print_signed
  206.                  Displays a one word number (from AX) as a signed number
  207.                  (-32768 to +32767).
  208.  
  209.              get_signed_4byte
  210.                  Enters a 4 byte signed number (-2,147,483,648 to
  211.                  +2,147,483,647). Commas are allowed. The address of the 4
  212.                  byte number must be in AX before calling the subroutine.
  213.  
  214.              print_signed_4byte
  215.                  Displays a 4 byte signed number (-2,147,483,648 to
  216.                  +2,147,483,647) with commas. The address of the 4 byte
  217.                  number must be in AX before calling the subroutine.
  218.  
  219.              get_signed_8byte
  220.                  Enters an 8 byte signed number (-9,223,372,036,854,775,808
  221.                  to +9,223,372,036,854,775,807). Commas are allowed. The
  222.                  address of the 8 byte number must be in AX before calling
  223.                  the subroutine. The screen prompt will show the last 3
  224.                  negative digits as -807 instead of -808, but this is because
  225.                  of lack of screen space.
  226.  
  227.              print_signed_8byte
  228.                  Displays an 8 byte signed number (-9,223,372,036,854,775,808
  229.                  to +9,223,372,036,854,775,807) with commas. The address of
  230.                  the 8 byte number must be in AX before calling the
  231.                  subroutine. 
  232.  
  233.  
  234.  
  235.              get_unsigned_byte
  236.                  Enters a one byte unsigned number (0 to 255) and returns it
  237.                  in AL.
  238.  
  239.              print_unsigned_byte
  240.                  Displays a one byte number (from AL) as an unsigned number
  241.                  (0 to 255).
  242.  
  243.              get_unsigned
  244.                  Enters a one word unsigned number (0 to 65535) and returns
  245.                  it in AX.
  246.  
  247.              print_unsigned
  248.                  Displays a one word number (from AX) as an unsigned number
  249.                  (0 to 65535).
  250.  
  251.              get_unsigned_4byte
  252.                  Enters a 4 byte unsigned number (0 to 4,294,967,295). Commas
  253.                  are allowed. The address of the 4 byte number must be in AX
  254.                  before calling the subroutine.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.              Appendix I - The PC Assembler Helper                            v
  261.              ____________________________________
  262.  
  263.              print_unsigned_4byte
  264.                  Displays a 4 byte unsigned number (0 to 4,294,967,295) with
  265.                  commas. The address of the 4 byte number must be in AX
  266.                  before calling the subroutine.
  267.  
  268.              get_unsigned_8byte
  269.                  Enters an 8 byte unsigned number (0 to
  270.                  18,446,744,073,709,551,615). Commas are allowed. The address
  271.                  of the 8 byte number must be in AX before calling the
  272.                  subroutine. 
  273.  
  274.              print_unsigned_8byte
  275.                  Displays an 8 byte unsigned number (0 to
  276.                  18,446,744,073,709,551,615) with commas. The address of the
  277.                  8 byte number must be in AX before calling the subroutine. 
  278.  
  279.  
  280.              Some of the above routines allow commas to be used for data
  281.              entry. These routines strip the commas before looking at the
  282.              number, so the following numbers all give the equivalent input:
  283.  
  284.                       2134875
  285.                       2,134,875
  286.                       21,,,34875
  287.                       2,1,3,4,8,7,5
  288.                       21,34,87,5
  289.  
  290.              show_regs
  291.                  Displays the 8086 registers on the top of the screen. Each
  292.                  call to show_regs increments a resettable counter so you can
  293.                  know where you are in the program. The counter starts with
  294.                  an initial value of 0. It also scrolls the screen up if the
  295.                  cursor is past line 19.
  296.  
  297.              show_regs_and_wait
  298.                  The same as show_regs except that it waits for you to press
  299.                  ENTER before continuing.
  300.  
  301.              set_count
  302.                  Sets the counter in show_regs to the value in AX. The new
  303.                  counter value (incremented by 1) will appear the next time
  304.                  show_regs is called.
  305.  
  306.              set_blue
  307.                  If you have a color monitor which is displaying color text,
  308.                  it sets the background to blue.
  309.  
  310.              get_continue
  311.                  Waits for you to press ENTER before continuing the program.
  312.                  It enters no data. See also set_timer below.
  313.  
  314.              set_timer
  315.                  In order to allow use with a debugger, it is possible to set
  316.                  a timer so the print functions keep control of the screen
  317.                  for a specific amount of time. To use set_timer, you put a
  318.                  number from 1 to 5 in AL, and call set_timer. This will
  319.                  cause a 1 to 5 second delay every time a print function or
  320.  
  321.  
  322.  
  323.  
  324.              The PC Assembler Tutor                                         vi
  325.              ______________________
  326.  
  327.                  show_regs is called. A 0 in AL will reset the timer to 0. A
  328.                  number larger than 5 in AL will cause ASMHELP to wait for
  329.                  you to press the ENTER key every time a print function or
  330.                  show_regs is called. 
  331.  
  332.              kill_timer
  333.                  Resets the timer to 0.
  334.  
  335.              set_reg_style
  336.                  Sets the display style of the individual registers. The
  337.                  correct order of the definition is:
  338.  
  339.                       AX, BX, CX, DX, SI, DI, BP, SP
  340.  
  341.                  The style values are:
  342.  
  343.                            FULL REGISTER OR RIGHT HALF REGISTER
  344.  
  345.                            signed    = 1d           1h
  346.                            unsigned  = 2d           2h
  347.                            binary    = 3d           3h
  348.                            hex       = 4d           4h
  349.                            ascii     = 5d           5h
  350.  
  351.                  plus (if applicable)
  352.  
  353.                            LEFT HALF REGISTER AND HALF REG. BIT
  354.  
  355.                            signed    = 144d         90h
  356.                            unsigned  = 160d         A0h
  357.                            binary    = 176d         B0h
  358.                            hex       = 192d         C0h
  359.                            ascii     = 208d         D0h
  360.  
  361.  
  362.                  set_reg_style makes a COPY of the information, which is used
  363.                  the next (and subsequent) times that show_regs is called.
  364.                  The next several paragraphs explain how this works. AX must
  365.                  contain the address of the 8 byte style definition array
  366.                  before calling set_reg_style.
  367.  
  368.  
  369.              REGISTER DISPLAY STYLE
  370.  
  371.              The 8086 contains a number of different registers. Some of these
  372.              always contain addresses and are always displayed in hex. These
  373.              are CS, DS, ES, SS and IP. They are always in hex and cannot be
  374.              changed. Also, each flag has an unchangeable style which will be
  375.              explained later.
  376.  
  377.              This still leaves us with AX, BX, CX, DX, SI, DI, BP and SP. Any
  378.              of these registers can be displayed in any style desired. In
  379.              addition, AX, BX, CX and DX can each be broken into two half
  380.              registers, and each half register has an independent style. The
  381.              default style is full register, unsigned. If you call show_regs
  382.              without setting a style, the eight abovementioned registers will
  383.              all display full, unsigned numbers.
  384.  
  385.  
  386.  
  387.  
  388.              Appendix I - The PC Assembler Helper                          vii
  389.              ____________________________________
  390.  
  391.  
  392.              In order to change the style, you need to set up an 8 byte style
  393.              definition array in your data segment. The correct definition for
  394.              this is the following:
  395.  
  396.              ax_byte  db   2
  397.              bx_byte  db   2
  398.              cx_byte  db   2
  399.              dx_byte  db   2
  400.              si_byte  db   2
  401.              di_byte  db   2
  402.              bp_byte  db   2
  403.              sp_byte  db   2
  404.  
  405.              This is the order that ASMHELP.OBJ expects. It is also the order
  406.              that the registers appear on the screen. The number 2 is the
  407.              default value for each byte. Once you have defined the 8 bytes,
  408.              you may alter any of them that you want to.
  409.  
  410.              The possible styles are signed, unsigned, binary, hex, and ascii.
  411.              If you look at a byte:
  412.  
  413.                  76543210
  414.                  HLLL0RRR
  415.  
  416.              the leftmost bit (80h or 128d) signals a half or a full register.
  417.              If it is 1, you get a half register, if it is 0, you get a full
  418.              register. bits 4,5 and 6 represent the left half register (if
  419.              appropriate), while bits 0,1 and 2 represent either the full
  420.              register or the right half register. For SI, DI, BP and SP, only
  421.              bits 0, 1 and 2 are significant. For AX, BX, CX and DX, all bits
  422.              except bit 3 are significant. 
  423.  
  424.              The code for bits 0, 1 and 2 is the following:
  425.  
  426.                  signed    = 1d           1h
  427.                  unsigned  = 2d           2h
  428.                  binary    = 3d           3h
  429.                  hex       = 4d           4h
  430.                  ascii     = 5d           5h
  431.  
  432.              This is the correct code for either a full register or the right
  433.              half register.
  434.  
  435.              If you want half registers, you must add 80h (128d) and the code
  436.              for the left half register. We have for the left half register:
  437.  
  438.                                DECIMAL                 HEX
  439.  
  440.                  signed    = 16d  + 128d            10h + 80h
  441.                  unsigned  = 32d  + 128d            20h + 80h
  442.                  binary    = 48d  + 128d            30h + 80h
  443.                  hex       = 64d  + 128d            40h + 80h
  444.                  ascii     = 80d  + 128d            50h + 80h
  445.  
  446.              which is the same as the above codes but shifted left 4 bits.
  447.              Since the 128d and the left half register code always appear in
  448.  
  449.  
  450.  
  451.  
  452.              The PC Assembler Tutor                                       viii
  453.              ______________________
  454.  
  455.              tandem, we may simply add them together. This gives us:
  456.  
  457.                            DECIMAL        HEX
  458.  
  459.                  signed    = 144d         90h
  460.                  unsigned  = 160d         A0h
  461.                  binary    = 176d         B0h
  462.                  hex       = 192d         C0h
  463.                  ascii     = 208d         D0h
  464.  
  465.              Here are some examples:
  466.  
  467.                  signed left + hex right            = 144 + 4 = 148
  468.                  ascii left  + unsigned right       = 208 + 2 = 210
  469.                  binary left + ascii right          = 176 + 5 = 181
  470.  
  471.              Simply move the constant to the appropriate byte:
  472.  
  473.                  mov  cx_byte, 210        ; ascii left, unsigned right
  474.                  mov  ax_byte, 5          ; full register, ascii
  475.                  mov  si_byte, 1          ; full register signed
  476.                  mov  dx_byte, 148        ; signed left, hex right
  477.                  mov  bx_byte, 4          ; full register, hex
  478.  
  479.              After you have changed all the styles you want to, put the
  480.              address of ax_byte (the first byte of the array) in ax and call
  481.              set_reg_style:
  482.  
  483.                  lea  ax, ax_byte
  484.                  call set_reg_style
  485.  
  486.              ASMHELP.OBJ uses the address in AX and stores a COPY of those 8
  487.              bytes. The next time you call show_regs, it will use this copy to
  488.              define the styles. If you make a mistake, it will default to
  489.              unsigned. 
  490.  
  491.              Registers are displayed the same way as with the 'print_'
  492.              subroutines. Unsigned numbers have no sign. Signed numbers have a
  493.              + or -, hex has an 'H', binary is either 8 or 16 digits, and
  494.              ascii has a single asterisk '*' unless one of the characters is
  495.              not printable ( 00d to 32d, 127d and 255d) in which case the non-
  496.              printable character will be written as a two digit hex number,
  497.              and a double asterisk will signal the event. 
  498.  
  499.  
  500.  
  501.              Finally, the flags are displayed as follows:
  502.  
  503.              OF, IEF, TF, ZF, AF, and CF are blank if they are not set and
  504.              have an X if they are set.
  505.  
  506.              DF has a + or a - to indicate increment or decrement.
  507.  
  508.              SF has a + or a - to indicate the sign.
  509.  
  510.              PF has E (for even) or O (for odd).
  511.  
  512.  
  513.  
  514.  
  515.  
  516.              Appendix I - The PC Assembler Helper                           ix
  517.              ____________________________________
  518.  
  519.  
  520.  
  521.              LINKING
  522.  
  523.              In order to use ASMHELP.OBJ you must have some standard segments
  524.              in your program. The standard code segment is defined as:
  525.  
  526.                  CODESTUFF SEGMENT PUBLIC 'CODE'
  527.  
  528.              and the standard data segment is:
  529.  
  530.                  DATASTUFF SEGMENT PUBLIC 'DATA'
  531.  
  532.              In addition you need a stack segment:
  533.  
  534.                  STACKSEG SEGMENT STACK 'STACK'
  535.  
  536.              which should have at least 100 bytes for ASMHELP to use.
  537.  
  538.              ASMHELP.OBJ expects that when you call one of its routines the
  539.              following conditions are met:
  540.  
  541.                  (1) It is a near call, and CS is set to the CODESTUFF
  542.                  segment.
  543.  
  544.                  (2) DS is set to the DATASTUFF segment. Any data which is
  545.                  longer than one word long and is being transferred must be
  546.                  in the DATASTUFF segment and its offset address must be in
  547.                  AX. For one byte or one word data, the data itself is in
  548.                  AX/AL.
  549.  
  550.                  (3) There is available stack space.
  551.  
  552.              In order to link properly, any subroutine which is called must
  553.              have an EXTRN statement.
  554.  
  555.                  EXTRN  show_regs:NEAR
  556.  
  557.              If the above conditions hold, then simply link your object file
  558.              with asmhelp.obj:
  559.  
  560.                  C> link myfile.obj+asmhelp.obj
  561.  
  562.              and the subroutines will be usable.
  563.  
  564.  
  565.  
  566.              ALIASES
  567.  
  568.              The subroutine names were chosen so their functions would be
  569.              completely clear. However, they tend to be long so if you use
  570.              them with some frequency it would be easier to use aliases. Make
  571.              a redefinition macro file and then include it at the beginning of
  572.              the program. For instance, if you have:
  573.  
  574.                  call print_unsigned_8byte
  575.  
  576.  
  577.  
  578.  
  579.  
  580.              The PC Assembler Tutor                                          x
  581.              ______________________
  582.  
  583.              you might want the EQU statement
  584.  
  585.                  prt_u8  EQU  print_unsigned_8byte
  586.  
  587.              and then rewrite the call:
  588.  
  589.                  call prt_u8
  590.  
  591.              Include redefinitions which are reasonable to you and put them in
  592.              a file REDEF.MAC. 
  593.  
  594.                  prt_s8    EQU  print_signed_8byte
  595.                  get_u4    EQU  get_unsigned_4byte
  596.                  show_rw   EQU  show_regs_and_wait
  597.  
  598.              Then all you need on the first line of your program is:
  599.  
  600.                  include REDEF.MAC
  601.  
  602.              and the assembler will do the work for you. 
  603.  
  604.  
  605.  
  606.              MEMORY RESIDENT SHOW_REGS
  607.  
  608.              If you are not using a debugger, it is possible to have the
  609.              show_regs portion of The Assembler Helper resident in memory.
  610.              This means that once it is installed, it will stay there till you
  611.              turn the machine off or reset the machine. The name of the
  612.              program is HELPMEM.COM and it is in \XTRAFILE. It operates
  613.              exactly the same way as show_regs except you get to it by using
  614.              INT 3. At that point you can set TF to do single stepping. 
  615.  
  616.              You load it into memory by typing:
  617.  
  618.                  >helpmem
  619.  
  620.              and it will wait for you to send interrupts. 
  621.  
  622.              The first time you do INT 3, you will see the normal show_regs
  623.              screen. The count is reset to 0 each time you have an INT 3.
  624.              There will also be two menu lines:
  625.  
  626.              ----------
  627.              0=clear TF ; X=set TF ; A=regs from ax ; B=set count ; C=continue
  628.              1=ax ; 2=bx ; 3=cx ; 4=dx ; 5=si ; 6=di ; 7=bp ; 8=sp
  629.              ----------
  630.  
  631.              This is pretty clear. 0 clears TF and X sets TF. If you press B
  632.              you will be prompted for a new count number. C lets you continue.
  633.              You can set the registers individually. Each register has a
  634.              number; ax is 1, bx is 2, etc. When you press the number, you
  635.              will be prompted for a HEX style code. This is the same style
  636.              code you have been using all the time.
  637.  
  638.              Finally, if you want to transfer the style information from your
  639.              program, do the following:
  640.  
  641.  
  642.  
  643.  
  644.              Appendix I - The PC Assembler Helper                           xi
  645.              ____________________________________
  646.  
  647.  
  648.                  mov  ax, offset ax_byte
  649.                  int  3
  650.  
  651.              Load the address of ax_byte in AX before the interrupt, and then
  652.              press selection A. The 8 bytes located at the address in AX will
  653.              be transfered to HELPMEM. The advantage of this is that you can
  654.              run ASMHELP concurrently, and they will both show the same
  655.              register styles. 
  656.  
  657.  
  658.              When you move into single step mode, you get a different prompt
  659.              line:
  660.  
  661.              ----------
  662.              0 = clear TF and continue  ;  2 = menu  ;  other keys = continue 
  663.              ----------
  664.  
  665.              0 clears TF, 2 sends you to the above menu, and any other key
  666.              will continue the program with TF set.
  667.  
  668.  
  669.              As is true with all debuggers, you should not single step through
  670.              subroutine calls since the subroutine might have hundreds or
  671.              thousands of steps. In addition, the subroutines in ASMHELP store
  672.              the flags. This means that they may store the flags with the trap
  673.              flag set. If you clear the trap flag while inside ASMHELP, when
  674.              the code exits ASMHELP it will POP the flags with the trap flag
  675.              set. If this happens, keep pressing 0 until you get out of single
  676.              step mode.
  677.  
  678.              The memory resident version works fine for single stepping as
  679.              long as there are no interrupts or subroutine calls. The
  680.              show_regs in ASMHELP works fine inbetween subroutine calls but
  681.              requires a lot of coding for single stepping. Therefore, a
  682.              strategy for using these two programs in conjunction is:
  683.  
  684.                  1) use the same register style definition array for both
  685.                  programs.
  686.  
  687.                  2) when there is only 8086 code with no interrupts or
  688.                  subroutine calls, use INT 3 and single step.
  689.  
  690.                  3) When there are interrupts and subroutines interspersed
  691.                  with the 8086 instructions, switch to ASMHELP.
  692.  
  693.              The screens should look the same except the count will be
  694.              different. 
  695.  
  696.  
  697.  
  698.              I/O
  699.  
  700.              All data i/o is done to the current screen at the current cursor
  701.              position. As long as you are in a text mode, ASMHELP should write
  702.              to whatever is current.
  703.  
  704.  
  705.  
  706.  
  707.  
  708.              The PC Assembler Tutor                                        xii
  709.              ______________________
  710.  
  711.              SHOW_REGS is a different matter. The only allowed modes are 2, 3
  712.              and 7. If you enter in modes 2, 3 or 7, it will keep the same
  713.              mode. If it is in any other mode, the video card will be forced
  714.              to mode 3.
  715.  
  716.              The memory resident version does almost the same thing. Every
  717.              time it is called, it checks for modes 2, 3 or 7, and if the mode
  718.              is not one of these, changes the mode to mode 3. If the mode is
  719.              3, then HELPMEM looks at the first character on page 0 and uses
  720.              the attribute of that character for all its display operations.
  721.              Whatever display attribute is in the upper left hand corner of
  722.              page 0 will be the display attribute for everything.
  723.  
  724.              The register display occupies the first 10 lines of page 0 of
  725.              whatever mode you are in. This is written directly to memory and
  726.              cannot be changed. Both versions change the page to page 0 upon
  727.              entry. If you are on another page, after a call to show_regs you
  728.              will be on page 0 at its current cursor position. 
  729.  
  730.              If you use ASMHELP in a programming environment or with a
  731.              debugger there may be conflicts as to who controls the screen
  732.              display. HELPMEM.COM should not be used in a programming
  733.              environment and cannot be used with a debugger, since both
  734.              HELPMEM and the debugger try to use the same interrupts.
  735.  
  736.